class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: C = None
        self.w: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: I = 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.t: I = None
        self.p: I = None
        self.z: G = None
        self.x: H = None
        self.q: B = None
        self.y: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: E = None
        self.y: D = None
        self.w: E = None
        self.x: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: I = None
        self.o: D = None
        self.z: C = None
        self.y: H = None
        self.q: C = None
        self.u: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: H = None
        self.s: D = None
        self.w: F = None
        self.t: C = None
        self.v: C = None
        self.x: D = None
        self.y: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: I = 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.t: I = None
        self.p: I = None
        self.z: G = None
        self.x: H = None
        self.q: B = None
        self.y: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: E = None
        self.y: D = None
        self.w: E = None
        self.x: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: I = None
        self.o: D = None
        self.z: C = None
        self.y: H = None
        self.q: C = None
        self.u: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: H = None
        self.s: D = None
        self.w: F = None
        self.t: C = None
        self.v: C = None
        self.x: D = None
        self.y: D = None
        self.txt = txt

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

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