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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: A = None
        self.v: F = None
        self.w: D = None
        self.q: E = None
        self.p: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: A = None
        self.o: E = None
        self.u: A = None
        self.t: D = None
        self.s: A = None
        self.txt = txt

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

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

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

a = A("a")
b = B("b")
c = C("c")
f = D("f")
m = E("m")
n = F("n")
k = C("k")
h = E("h")
i = F("i")

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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: A = None
        self.v: F = None
        self.w: D = None
        self.q: E = None
        self.p: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: A = None
        self.o: E = None
        self.u: A = None
        self.t: D = None
        self.s: A = None
        self.txt = txt

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

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

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

a = A("a")
b = B("b")
c = C("c")
f = D("f")
m = E("m")
n = F("n")
k = C("k")
h = E("h")
i = F("i")

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