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

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

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

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

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

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

a = A("a")
l = B("l")
b = C("b")
f = D("f")
c = E("c")
k = F("k")
h = F("h")
e = C("e")

a.u = h
a.z = l
l.w = k
b.r = l
b.x = e
f.t = c
f.y = k
c.q = h
c.v = l
c.z = e
k.p = e
k.u = b
k.y = b
k.q = f
k.r = l
k.z = l
h.p = e
h.y = e
h.u = b
h.q = f
h.r = l
h.z = l
e.r = l
e.x = b
assert k.r.w.q.t.q.u.x.r.txt == "
class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: B = None
        self.txt = txt

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

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

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

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

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

a = A("a")
l = B("l")
b = C("b")
f = D("f")
c = E("c")
k = F("k")
h = F("h")
e = C("e")

a.u = h
a.z = l
l.w = k
b.r = l
b.x = e
f.t = c
f.y = k
c.q = h
c.v = l
c.z = e
k.p = e
k.u = b
k.y = b
k.q = f
k.r = l
k.z = l
h.p = e
h.y = e
h.u = b
h.q = f
h.r = l
h.z = l
e.r = l
e.x = b
assert k.r.w.q.t.q.u.x.r.txt == "l"