class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: I = None
        self.v: E = None
        self.w: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: I = None
        self.p: E = None
        self.u: H = None
        self.x: F = None
        self.q: E = None
        self.o: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: J = None
        self.v: B = None
        self.s: B = None
        self.q: E = None
        self.x: H = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: J = None
        self.t: H = None
        self.w: A = None
        self.v: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.q: F = None
        self.p: E = None
        self.o: D = None
        self.w: J = None
        self.v: H = None
        self.y: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: J = None
        self.r: D = None
        self.o: F = None
        self.v: G = None
        self.y: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: D = None
        self.y: G = None
        self.q: D = None
        self.u: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: I = None
        self.s: B = None
        self.q: E = None
        self.r: G = None
        self.v: A = None
        self.x: C = None
        self.o: G = None
        self.y: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: I = None
        self.p: E = None
        self.u: H = None
        self.x: F = None
        self.q: E = None
        self.o: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: J = None
        self.v: B = None
        self.s: B = None
        self.q: E = None
        self.x: H = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: J = None
        self.t: H = None
        self.w: A = None
        self.v: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.q: F = None
        self.p: E = None
        self.o: D = None
        self.w: J = None
        self.v: H = None
        self.y: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: J = None
        self.r: D = None
        self.o: F = None
        self.v: G = None
        self.y: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: D = None
        self.y: G = None
        self.q: D = None
        self.u: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: I = None
        self.s: B = None
        self.q: E = None
        self.r: G = None
        self.v: A = None
        self.x: C = None
        self.o: G = None
        self.y: B = None
        self.txt = txt

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

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