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

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

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: A = None
        self.x: F = None
        self.txt = txt

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

b.o = a
k.t = b
k.z = a
k.r = a
k.v = e
k.u = d
k.x = d
e.x = d
d.q = b
h.v = a
h.z = n
h.o = b
f.x = h
f.q = k
a.z = k
a.u = b
a.x = f
n.q = b
assert n.q.o.x.q.v.txt == "
class A:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: A = None
        self.x: F = None
        self.txt = txt

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

b.o = a
k.t = b
k.z = a
k.r = a
k.v = e
k.u = d
k.x = d
e.x = d
d.q = b
h.v = a
h.z = n
h.o = b
f.x = h
f.q = k
a.z = k
a.u = b
a.x = f
n.q = b
assert n.q.o.x.q.v.txt == "e"