class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: E = None
        self.v: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: A = None
        self.u: H = None
        self.r: A = None
        self.p: E = None
        self.q: C = None
        self.s: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: C = None
        self.x: A = None
        self.r: E = None
        self.y: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.u: H = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: A = None
        self.u: H = None
        self.r: A = None
        self.p: E = None
        self.q: C = None
        self.s: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: C = None
        self.x: A = None
        self.r: E = None
        self.y: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.u: H = None
        self.txt = txt

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

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

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