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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.w: E = None
        self.v: A = None
        self.q: G = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: C = None
        self.q: A = None
        self.v: F = None
        self.t: A = None
        self.w: E = None
        self.p: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.w: E = None
        self.v: A = None
        self.q: G = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: C = None
        self.q: A = None
        self.v: F = None
        self.t: A = None
        self.w: E = None
        self.p: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: B = None
        self.txt = txt

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

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