class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: I = None
        self.t: I = None
        self.o: I = None
        self.s: E = None
        self.q: G = None
        self.p: C = None
        self.y: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: I = None
        self.p: G = None
        self.y: A = None
        self.z: B = None
        self.w: I = None
        self.r: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: I = None
        self.t: I = None
        self.o: I = None
        self.s: E = None
        self.q: G = None
        self.p: C = None
        self.y: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: I = None
        self.p: G = None
        self.y: A = None
        self.z: B = None
        self.w: I = None
        self.r: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

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