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

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: D = None
        self.w: A = None
        self.x: G = None
        self.t: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.w: G = None
        self.y: B = None
        self.q: C = None
        self.x: D = None
        self.z: B = None
        self.p: F = None
        self.t: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: D = None
        self.w: A = None
        self.x: G = None
        self.t: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.w: G = None
        self.y: B = None
        self.q: C = None
        self.x: D = None
        self.z: B = None
        self.p: F = None
        self.t: A = None
        self.txt = txt

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

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