class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: E = None
        self.t: C = None
        self.q: E = None
        self.o: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.r: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.r: H = None
        self.z: F = None
        self.t: D = None
        self.w: C = None
        self.p: B = None
        self.y: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: D = None
        self.o: F = None
        self.u: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

f = A("f")
a = B("a")
e = C("e")
d = D("d")
c = E("c")
h = F("h")
n = G("n")
m = H("m")

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

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.r: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.r: H = None
        self.z: F = None
        self.t: D = None
        self.w: C = None
        self.p: B = None
        self.y: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: D = None
        self.o: F = None
        self.u: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

f = A("f")
a = B("a")
e = C("e")
d = D("d")
c = E("c")
h = F("h")
n = G("n")
m = H("m")

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