class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: B = None
        self.u: B = None
        self.x: H = None
        self.y: E = None
        self.r: C = None
        self.s: E = None
        self.q: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: H = None
        self.s: G = None
        self.q: D = None
        self.p: G = None
        self.w: C = None
        self.u: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: H = None
        self.x: B = None
        self.t: B = None
        self.r: E = None
        self.u: B = None
        self.s: D = None
        self.q: A = None
        self.p: B = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: H = None
        self.s: G = None
        self.q: D = None
        self.p: G = None
        self.w: C = None
        self.u: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: H = None
        self.x: B = None
        self.t: B = None
        self.r: E = None
        self.u: B = None
        self.s: D = None
        self.q: A = None
        self.p: B = None
        self.txt = txt

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

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

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

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