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

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

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

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

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

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

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

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

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

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

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

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

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

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

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