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

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

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

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

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

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

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

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

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

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

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

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

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

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

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