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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: C = None
        self.v: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: G = None
        self.w: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.s: A = None
        self.t: B = None
        self.q: G = None
        self.r: C = None
        self.v: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: C = None
        self.v: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: G = None
        self.w: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.s: A = None
        self.t: B = None
        self.q: G = None
        self.r: C = None
        self.v: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

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