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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: J = None
        self.x: I = None
        self.p: D = None
        self.s: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: B = None
        self.z: A = None
        self.w: B = None
        self.r: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.t: H = None
        self.y: F = None
        self.q: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.v: H = None
        self.q: A = None
        self.w: I = None
        self.o: C = None
        self.y: E = None
        self.z: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: J = None
        self.x: I = None
        self.p: D = None
        self.s: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: B = None
        self.z: A = None
        self.w: B = None
        self.r: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.t: H = None
        self.y: F = None
        self.q: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.v: H = None
        self.q: A = None
        self.w: I = None
        self.o: C = None
        self.y: E = None
        self.z: H = None
        self.txt = txt

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

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