class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.v: D = None
        self.q: D = None
        self.w: F = None
        self.u: D = None
        self.x: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: C = None
        self.w: E = None
        self.q: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.p: A = None
        self.r: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: B = None
        self.y: A = None
        self.o: F = None
        self.txt = txt

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

l = A("l")
n = B("n")
b = C("b")
f = D("f")
c = E("c")
k = F("k")

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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: C = None
        self.w: E = None
        self.q: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.p: A = None
        self.r: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: B = None
        self.y: A = None
        self.o: F = None
        self.txt = txt

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

l = A("l")
n = B("n")
b = C("b")
f = D("f")
c = E("c")
k = F("k")

l.t = n
l.v = f
l.q = f
l.u = f
l.w = k
l.x = c
n.z = l
n.s = b
n.q = b
n.w = c
b.o = k
f.z = k
f.p = l
f.r = b
c.z = n
c.w = n
c.y = l
c.o = k
k.y = b
assert k.y.o.y.o.txt == "k"