class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.u: F = None
        self.o: H = None
        self.x: E = None
        self.v: G = None
        self.r: H = None
        self.w: F = None
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: I = None
        self.x: E = None
        self.p: G = None
        self.o: C = None
        self.u: A = None
        self.z: G = None
        self.t: C = None
        self.v: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: C = None
        self.x: G = None
        self.v: A = None
        self.s: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: F = None
        self.x: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: A = None
        self.u: C = None
        self.r: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.u: F = None
        self.o: H = None
        self.x: E = None
        self.v: G = None
        self.r: H = None
        self.w: F = None
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: I = None
        self.x: E = None
        self.p: G = None
        self.o: C = None
        self.u: A = None
        self.z: G = None
        self.t: C = None
        self.v: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: C = None
        self.x: G = None
        self.v: A = None
        self.s: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: F = None
        self.x: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: A = None
        self.u: C = None
        self.r: E = None
        self.txt = txt

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

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