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

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

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

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

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

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

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

b.w = f
b.q = m
b.t = d
m.o = g
e.x = l
c.p = b
c.t = n
c.q = n
c.v = n
c.x = j
c.w = j
n.u = b
d.w = c
d.x = e
g.w = c
g.x = e
l.p = b
l.t = n
l.q = n
l.v = n
l.x = c
l.w = c
j.p = b
j.t = n
j.q = n
j.v = n
j.x = c
j.w = c
f.o = d
assert l.t.u.t.w.t.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: B = None
        self.t: F = None
        self.txt = txt

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

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

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

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

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

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

b.w = f
b.q = m
b.t = d
m.o = g
e.x = l
c.p = b
c.t = n
c.q = n
c.v = n
c.x = j
c.w = j
n.u = b
d.w = c
d.x = e
g.w = c
g.x = e
l.p = b
l.t = n
l.q = n
l.v = n
l.x = c
l.w = c
j.p = b
j.t = n
j.q = n
j.v = n
j.x = c
j.w = c
f.o = d
assert l.t.u.t.w.t.u.txt == "b"