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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: E = None
        self.v: D = None
        self.o: E = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: E = None
        self.v: D = None
        self.o: E = None
        self.txt = txt

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

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

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

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

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

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