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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: H = None
        self.r: D = None
        self.x: I = None
        self.p: J = None
        self.s: A = None
        self.w: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.v: F = None
        self.o: F = None
        self.z: A = None
        self.t: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: J = None
        self.w: H = None
        self.z: J = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: J = None
        self.v: H = None
        self.y: H = None
        self.s: B = None
        self.t: A = None
        self.w: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: F = None
        self.u: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: H = None
        self.r: D = None
        self.x: I = None
        self.p: J = None
        self.s: A = None
        self.w: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.v: F = None
        self.o: F = None
        self.z: A = None
        self.t: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: J = None
        self.w: H = None
        self.z: J = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: J = None
        self.v: H = None
        self.y: H = None
        self.s: B = None
        self.t: A = None
        self.w: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: F = None
        self.u: C = None
        self.txt = txt

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

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