class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: D = None
        self.v: D = None
        self.p: D = None
        self.y: E = None
        self.s: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: C = None
        self.z: F = None
        self.q: B = None
        self.txt = txt

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

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

i = A("i")
l = B("l")
f = C("f")
m = D("m")
e = E("e")
j = F("j")
k = B("k")
n = E("n")

i.x = n
l.x = k
f.x = n
f.y = n
f.o = m
f.v = m
f.p = m
f.s = k
m.x = f
m.r = f
m.z = j
m.q = l
e.u = j
j.q = m
j.z = e
j.v = e
k.x = l
n.u = j
assert k.x.x.x.x.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: D = None
        self.v: D = None
        self.p: D = None
        self.y: E = None
        self.s: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: C = None
        self.z: F = None
        self.q: B = None
        self.txt = txt

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

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

i = A("i")
l = B("l")
f = C("f")
m = D("m")
e = E("e")
j = F("j")
k = B("k")
n = E("n")

i.x = n
l.x = k
f.x = n
f.y = n
f.o = m
f.v = m
f.p = m
f.s = k
m.x = f
m.r = f
m.z = j
m.q = l
e.u = j
j.q = m
j.z = e
j.v = e
k.x = l
n.u = j
assert k.x.x.x.x.x.x.txt == "k"