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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: C = None
        self.q: F = None
        self.s: C = None
        self.txt = txt

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

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

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

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

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

e.t = k
g.y = j
g.p = k
g.s = k
g.q = m
k.y = j
k.v = j
k.z = f
j.o = g
l.u = f
m.t = f
f.u = l
assert f.u.u.u.u.u.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: C = None
        self.q: F = None
        self.s: C = None
        self.txt = txt

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

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

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

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

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

e.t = k
g.y = j
g.p = k
g.s = k
g.q = m
k.y = j
k.v = j
k.z = f
j.o = g
l.u = f
m.t = f
f.u = l
assert f.u.u.u.u.u.u.u.txt == "l"