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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: G = None
        self.z: G = None
        self.q: C = None
        self.p: G = None
        self.r: B = None
        self.u: B = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: G = None
        self.z: G = None
        self.q: C = None
        self.p: G = None
        self.r: B = None
        self.u: B = None
        self.txt = txt

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

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

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

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