class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: A = None
        self.x: E = None
        self.r: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: A = None
        self.o: G = None
        self.q: C = None
        self.s: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.q: A = None
        self.r: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: D = None
        self.x: G = None
        self.r: H = None
        self.y: F = None
        self.s: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: H = None
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.t: D = None
        self.v: D = None
        self.x: C = None
        self.o: B = None
        self.u: B = None
        self.r: A = None
        self.txt = txt

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

j = A("j")
b = B("b")
h = C("h")
n = D("n")
m = E("m")
f = F("f")
a = G("a")
d = H("d")
i = A("i")
k = C("k")

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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: A = None
        self.o: G = None
        self.q: C = None
        self.s: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.q: A = None
        self.r: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: D = None
        self.x: G = None
        self.r: H = None
        self.y: F = None
        self.s: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: H = None
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.t: D = None
        self.v: D = None
        self.x: C = None
        self.o: B = None
        self.u: B = None
        self.r: A = None
        self.txt = txt

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

j = A("j")
b = B("b")
h = C("h")
n = D("n")
m = E("m")
f = F("f")
a = G("a")
d = H("d")
i = A("i")
k = C("k")

j.p = f
j.s = i
j.x = m
j.r = n
b.p = m
b.v = i
b.s = i
b.o = a
b.q = h
h.o = i
h.q = j
h.r = d
n.y = j
n.x = f
n.q = f
n.v = f
n.p = f
n.r = k
n.t = k
n.u = m
m.u = b
m.t = n
m.x = a
m.s = a
m.r = d
m.y = f
f.p = d
f.x = a
a.p = d
a.t = n
a.v = n
a.x = h
a.o = b
a.u = b
a.r = j
d.u = k
d.r = j
d.v = f
i.p = f
i.s = j
i.x = m
i.r = n
k.o = j
k.q = i
k.r = d
assert n.u.x.x.txt == "h"