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

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

class C:
    def __init__(self, txt: str):
        self.v: C = None
        self.t: F = None
        self.w: F = None
        self.z: C = None
        self.y: A = None
        self.r: F = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: C = None
        self.t: F = None
        self.w: F = None
        self.z: C = None
        self.y: A = None
        self.r: F = None
        self.txt = txt

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

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

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

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

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