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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: B = None
        self.z: H = None
        self.u: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: F = None
        self.s: C = None
        self.z: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: G = None
        self.t: A = None
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: F = None
        self.w: H = None
        self.q: F = None
        self.p: D = None
        self.txt = txt

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

c = A("c")
j = B("j")
f = C("f")
n = D("n")
b = E("b")
a = F("a")
g = G("g")
d = H("d")
h = G("h")

c.p = d
c.v = b
c.s = j
j.o = h
f.v = g
n.p = f
n.t = j
n.z = d
n.u = c
b.t = f
b.s = f
b.o = a
b.z = j
a.u = j
a.s = h
a.t = c
a.r = g
g.u = j
g.x = a
g.q = a
g.w = d
g.p = n
d.p = j
d.z = n
h.u = j
h.x = a
h.q = a
h.w = d
h.p = n
assert a.r.u.o.x.u.o.u.txt == "
class A:
    def __init__(self, txt: str):
        self.p: H = None
        self.v: E = None
        self.s: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: B = None
        self.z: H = None
        self.u: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: F = None
        self.s: C = None
        self.z: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: G = None
        self.t: A = None
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: F = None
        self.w: H = None
        self.q: F = None
        self.p: D = None
        self.txt = txt

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

c = A("c")
j = B("j")
f = C("f")
n = D("n")
b = E("b")
a = F("a")
g = G("g")
d = H("d")
h = G("h")

c.p = d
c.v = b
c.s = j
j.o = h
f.v = g
n.p = f
n.t = j
n.z = d
n.u = c
b.t = f
b.s = f
b.o = a
b.z = j
a.u = j
a.s = h
a.t = c
a.r = g
g.u = j
g.x = a
g.q = a
g.w = d
g.p = n
d.p = j
d.z = n
h.u = j
h.x = a
h.q = a
h.w = d
h.p = n
assert a.r.u.o.x.u.o.u.txt == "j"