class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: C = None
        self.w: J = None
        self.r: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: D = None
        self.z: G = None
        self.o: G = None
        self.x: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: J = None
        self.x: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: I = None
        self.q: A = None
        self.v: A = None
        self.y: F = None
        self.t: A = None
        self.o: E = None
        self.r: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: I = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: D = None
        self.z: G = None
        self.o: G = None
        self.x: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: J = None
        self.x: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: I = None
        self.q: A = None
        self.v: A = None
        self.y: F = None
        self.t: A = None
        self.o: E = None
        self.r: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: I = None
        self.txt = txt

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

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

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

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