class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: B = None
        self.z: F = None
        self.p: E = None
        self.y: C = None
        self.txt = txt

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

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

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

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

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

l = A("l")
m = B("m")
e = C("e")
a = D("a")
i = E("i")
b = F("b")

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

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

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

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

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

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

l = A("l")
m = B("m")
e = C("e")
a = D("a")
i = E("i")
b = F("b")

l.t = m
l.r = m
l.z = b
l.p = i
l.y = e
m.x = i
e.v = m
e.q = l
e.x = i
a.x = b
i.z = a
b.y = e
b.r = a
b.q = i
b.u = i
b.w = m
b.p = m
assert m.x.z.x.r.txt == "a"