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

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

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: F = None
        self.u: A = None
        self.y: E = None
        self.q: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.q: E = None
        self.x: F = None
        self.z: C = None
        self.p: G = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: F = None
        self.u: A = None
        self.y: E = None
        self.q: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.q: E = None
        self.x: F = None
        self.z: C = None
        self.p: G = None
        self.txt = txt

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

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

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

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