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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.p: C = None
        self.x: F = None
        self.y: G = None
        self.t: E = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: C = None
        self.z: B = None
        self.v: A = None
        self.q: B = None
        self.o: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.p: C = None
        self.x: F = None
        self.y: G = None
        self.t: E = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: C = None
        self.z: B = None
        self.v: A = None
        self.q: B = None
        self.o: F = None
        self.txt = txt

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

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

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