class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: I = None
        self.v: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: G = None
        self.u: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: B = None
        self.q: C = None
        self.u: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: I = None
        self.p: D = None
        self.r: C = None
        self.x: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: A = None
        self.u: C = None
        self.txt = txt

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

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

i.t = j
i.r = l
i.v = b
a.q = i
a.u = i
a.v = g
e.x = n
b.q = e
b.o = i
h.x = a
h.r = a
h.u = a
h.q = e
j.r = i
j.w = l
j.y = a
j.o = b
j.z = b
j.t = b
j.s = e
j.v = g
j.p = h
g.o = a
g.w = l
g.p = b
g.r = e
g.x = i
n.q = i
n.s = i
n.u = e
l.r = h
l.u = h
l.y = h
l.t = i
l.q = a
l.s = a
l.x = j
l.v = n
l.p = n
assert g.p.q.x.u.x.u.x.u.x.txt == "
class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: I = None
        self.v: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: G = None
        self.u: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: B = None
        self.q: C = None
        self.u: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: I = None
        self.p: D = None
        self.r: C = None
        self.x: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: A = None
        self.u: C = None
        self.txt = txt

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

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

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