class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: E = None
        self.p: F = None
        self.t: E = None
        self.q: H = None
        self.r: D = None
        self.y: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.t: G = None
        self.y: D = None
        self.u: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: D = None
        self.q: D = None
        self.z: A = None
        self.u: F = None
        self.s: A = None
        self.r: D = None
        self.p: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: A = None
        self.q: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.t: G = None
        self.y: D = None
        self.u: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: D = None
        self.q: D = None
        self.z: A = None
        self.u: F = None
        self.s: A = None
        self.r: D = None
        self.p: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: A = None
        self.q: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

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