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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

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

i = A("i")
n = B("n")
g = C("g")
m = D("m")
h = E("h")
e = F("e")
a = G("a")
c = H("c")

i.o = a
i.t = e
n.x = e
n.t = m
g.p = m
g.s = a
g.t = n
m.r = n
h.u = m
e.x = g
a.w = g
a.r = g
a.q = c
a.o = c
a.t = c
a.x = c
a.p = m
a.z = n
c.p = e
c.y = a
c.q = m
c.w = i
c.r = n
assert m.r.t.r.t.r.txt == "
class A:
    def __init__(self, txt: str):
        self.o: G = None
        self.t: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

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

i = A("i")
n = B("n")
g = C("g")
m = D("m")
h = E("h")
e = F("e")
a = G("a")
c = H("c")

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