class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: B = None
        self.w: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.u: B = None
        self.v: B = None
        self.y: A = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: C = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.o: F = None
        self.t: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: F = None
        self.o: E = None
        self.q: C = None
        self.s: E = None
        self.p: E = None
        self.txt = txt

f = A("f")
h = B("h")
d = C("d")
e = D("e")
l = E("l")
i = F("i")
k = C("k")
m = F("m")
a = D("a")
g = A("g")

f.y = a
f.v = h
f.w = g
h.q = d
d.o = m
d.u = h
d.v = h
d.y = f
d.x = f
e.r = a
e.u = k
e.p = h
l.y = d
l.o = i
l.t = g
i.u = f
i.z = m
i.o = l
i.s = l
i.p = l
i.q = d
k.o = i
k.u = h
k.v = h
k.y = f
k.x = g
m.u = g
m.z = i
m.o = l
m.s = l
m.p = l
m.q = k
a.r = e
a.u = k
a.p = h
g.y = a
g.v = h
g.w = f
assert h.q.x.y.r.r.r.r.p.q.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: B = None
        self.w: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.u: B = None
        self.v: B = None
        self.y: A = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: C = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.o: F = None
        self.t: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: F = None
        self.o: E = None
        self.q: C = None
        self.s: E = None
        self.p: E = None
        self.txt = txt

f = A("f")
h = B("h")
d = C("d")
e = D("e")
l = E("l")
i = F("i")
k = C("k")
m = F("m")
a = D("a")
g = A("g")

f.y = a
f.v = h
f.w = g
h.q = d
d.o = m
d.u = h
d.v = h
d.y = f
d.x = f
e.r = a
e.u = k
e.p = h
l.y = d
l.o = i
l.t = g
i.u = f
i.z = m
i.o = l
i.s = l
i.p = l
i.q = d
k.o = i
k.u = h
k.v = h
k.y = f
k.x = g
m.u = g
m.z = i
m.o = l
m.s = l
m.p = l
m.q = k
a.r = e
a.u = k
a.p = h
g.y = a
g.v = h
g.w = f
assert h.q.x.y.r.r.r.r.p.q.txt == "d"