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

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

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

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

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

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

b = A("b")
l = B("l")
f = C("f")
g = D("g")
a = E("a")
j = F("j")
m = C("m")

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

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

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

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

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

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

b = A("b")
l = B("l")
f = C("f")
g = D("g")
a = E("a")
j = F("j")
m = C("m")

b.t = l
b.s = g
l.z = a
l.x = b
l.v = b
l.s = f
l.q = g
f.r = b
g.t = f
g.r = b
g.u = a
g.p = j
g.y = j
g.s = l
a.z = b
a.v = j
j.q = b
j.u = b
j.t = l
m.r = b
assert a.v.t.x.t.z.z.txt == "b"