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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: E = None
        self.u: E = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.v: E = None
        self.y: B = None
        self.z: G = None
        self.w: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: F = None
        self.q: G = None
        self.o: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.s: H = None
        self.o: G = None
        self.x: D = None
        self.t: B = None
        self.w: A = None
        self.z: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: G = None
        self.z: B = None
        self.w: H = None
        self.x: E = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: E = None
        self.u: E = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.v: E = None
        self.y: B = None
        self.z: G = None
        self.w: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: F = None
        self.q: G = None
        self.o: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.s: H = None
        self.o: G = None
        self.x: D = None
        self.t: B = None
        self.w: A = None
        self.z: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: G = None
        self.z: B = None
        self.w: H = None
        self.x: E = None
        self.txt = txt

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

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

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

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