class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: H = None
        self.u: C = None
        self.x: H = None
        self.w: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: C = None
        self.p: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.y: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.z: H = None
        self.q: F = None
        self.o: C = None
        self.t: G = None
        self.u: C = None
        self.p: C = None
        self.txt = txt

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

c = A("c")
l = B("l")
b = C("b")
h = D("h")
n = E("n")
e = F("e")
k = G("k")
a = H("a")
m = G("m")

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: C = None
        self.p: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.y: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.z: H = None
        self.q: F = None
        self.o: C = None
        self.t: G = None
        self.u: C = None
        self.p: C = None
        self.txt = txt

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

c = A("c")
l = B("l")
b = C("b")
h = D("h")
n = E("n")
e = F("e")
k = G("k")
a = H("a")
m = G("m")

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