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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: F = None
        self.u: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: B = None
        self.z: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.w: B = None
        self.txt = txt

b = A("b")
k = B("k")
c = C("c")
e = D("e")
g = E("g")
i = F("i")
m = C("m")
h = D("h")
d = A("d")

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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: F = None
        self.u: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: B = None
        self.z: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.w: B = None
        self.txt = txt

b = A("b")
k = B("k")
c = C("c")
e = D("e")
g = E("g")
i = F("i")
m = C("m")
h = D("h")
d = A("d")

b.q = i
b.u = i
b.z = d
b.p = d
b.x = h
b.o = h
k.s = h
k.z = i
k.u = d
c.o = b
c.x = i
c.v = i
c.w = m
c.r = k
c.t = k
e.x = m
g.u = i
g.z = i
g.v = k
i.z = m
i.w = k
m.o = d
m.x = i
m.v = i
m.w = c
m.r = k
m.t = k
h.x = m
d.q = i
d.u = i
d.z = b
d.p = b
d.x = h
d.o = e
assert i.w.u.z.x.x.x.z.x.txt == "i"