class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: E = None
        self.w: H = None
        self.q: F = None
        self.s: I = None
        self.t: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: I = None
        self.u: J = None
        self.q: C = None
        self.y: E = None
        self.p: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: J = None
        self.t: G = None
        self.u: F = None
        self.w: J = None
        self.z: B = None
        self.o: E = None
        self.q: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.u: I = None
        self.w: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.z: F = None
        self.x: C = None
        self.s: G = None
        self.p: D = None
        self.o: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: A = None
        self.u: B = None
        self.t: B = None
        self.z: E = None
        self.x: A = None
        self.s: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: I = None
        self.u: J = None
        self.q: C = None
        self.y: E = None
        self.p: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: J = None
        self.t: G = None
        self.u: F = None
        self.w: J = None
        self.z: B = None
        self.o: E = None
        self.q: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.u: I = None
        self.w: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.z: F = None
        self.x: C = None
        self.s: G = None
        self.p: D = None
        self.o: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: A = None
        self.u: B = None
        self.t: B = None
        self.z: E = None
        self.x: A = None
        self.s: A = None
        self.txt = txt

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

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