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

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: D = None
        self.u: F = None
        self.x: F = None
        self.q: H = None
        self.v: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: D = None
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: B = None
        self.z: E = None
        self.y: A = None
        self.p: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

c = A("c")
g = B("g")
j = C("j")
l = D("l")
n = E("n")
f = F("f")
a = G("a")
e = H("e")

c.p = g
c.v = g
c.z = l
c.x = l
c.o = e
c.r = a
g.t = j
g.y = c
g.p = l
j.z = f
j.u = f
j.x = f
j.o = l
j.v = l
j.q = e
l.z = n
n.u = c
n.s = c
n.t = l
f.r = c
f.y = c
f.u = g
f.z = n
f.p = l
a.u = n
a.x = e
e.t = a
assert j.q.t.x.t.x.t.u.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: B = None
        self.z: D = None
        self.o: H = None
        self.r: G = None
        self.x: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: D = None
        self.u: F = None
        self.x: F = None
        self.q: H = None
        self.v: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: D = None
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: B = None
        self.z: E = None
        self.y: A = None
        self.p: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

c = A("c")
g = B("g")
j = C("j")
l = D("l")
n = E("n")
f = F("f")
a = G("a")
e = H("e")

c.p = g
c.v = g
c.z = l
c.x = l
c.o = e
c.r = a
g.t = j
g.y = c
g.p = l
j.z = f
j.u = f
j.x = f
j.o = l
j.v = l
j.q = e
l.z = n
n.u = c
n.s = c
n.t = l
f.r = c
f.y = c
f.u = g
f.z = n
f.p = l
a.u = n
a.x = e
e.t = a
assert j.q.t.x.t.x.t.u.txt == "n"