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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: D = None
        self.z: F = None
        self.u: D = None
        self.r: E = None
        self.t: F = None
        self.txt = txt

d = A("d")
b = B("b")
j = C("j")
m = D("m")
k = E("k")
c = F("c")
g = C("g")
l = F("l")

d.u = b
b.r = d
b.z = m
b.w = k
b.x = g
j.q = d
m.t = c
k.r = c
c.v = g
c.o = m
c.u = m
c.z = l
c.t = l
c.r = k
g.q = d
l.v = j
l.o = m
l.u = m
l.z = c
l.t = c
l.r = k
assert k.r.t.t.t.v.q.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: D = None
        self.z: F = None
        self.u: D = None
        self.r: E = None
        self.t: F = None
        self.txt = txt

d = A("d")
b = B("b")
j = C("j")
m = D("m")
k = E("k")
c = F("c")
g = C("g")
l = F("l")

d.u = b
b.r = d
b.z = m
b.w = k
b.x = g
j.q = d
m.t = c
k.r = c
c.v = g
c.o = m
c.u = m
c.z = l
c.t = l
c.r = k
g.q = d
l.v = j
l.o = m
l.u = m
l.z = c
l.t = c
l.r = k
assert k.r.t.t.t.v.q.u.txt == "b"