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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.t: F = None
        self.q: D = None
        self.r: H = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: G = None
        self.v: G = None
        self.o: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.t: F = None
        self.q: D = None
        self.r: H = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: G = None
        self.v: G = None
        self.o: C = None
        self.txt = txt

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

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

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