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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: D = None
        self.y: F = None
        self.p: D = None
        self.o: E = None
        self.txt = txt

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

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

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

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

b = A("b")
a = B("a")
e = C("e")
j = D("j")
i = E("i")
k = F("k")
d = F("d")
g = E("g")
c = D("c")
n = C("n")

b.z = i
a.z = b
a.x = j
a.y = k
a.p = c
a.o = i
e.s = a
j.r = k
i.s = k
i.x = a
k.v = g
k.u = a
k.q = j
d.v = i
d.u = a
d.q = j
g.s = k
g.x = a
c.r = k
n.s = a
assert k.q.r.q.r.v.s.u.z.z.s.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: D = None
        self.y: F = None
        self.p: D = None
        self.o: E = None
        self.txt = txt

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

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

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

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

b = A("b")
a = B("a")
e = C("e")
j = D("j")
i = E("i")
k = F("k")
d = F("d")
g = E("g")
c = D("c")
n = C("n")

b.z = i
a.z = b
a.x = j
a.y = k
a.p = c
a.o = i
e.s = a
j.r = k
i.s = k
i.x = a
k.v = g
k.u = a
k.q = j
d.v = i
d.u = a
d.q = j
g.s = k
g.x = a
c.r = k
n.s = a
assert k.q.r.q.r.v.s.u.z.z.s.txt == "k"