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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

i.r = a
i.x = g
i.o = e
i.u = d
i.q = n
n.q = l
n.r = j
n.v = g
n.z = g
n.u = a
a.z = n
a.t = i
g.v = l
g.r = l
k.x = g
k.r = d
k.o = e
j.w = l
l.q = n
l.r = j
l.v = g
l.z = g
l.u = a
d.x = g
d.r = k
d.o = e
e.w = l
assert a.z.q.v.v.r.w.r.w.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: D = None
        self.o: F = None
        self.u: E = None
        self.q: B = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

i.r = a
i.x = g
i.o = e
i.u = d
i.q = n
n.q = l
n.r = j
n.v = g
n.z = g
n.u = a
a.z = n
a.t = i
g.v = l
g.r = l
k.x = g
k.r = d
k.o = e
j.w = l
l.q = n
l.r = j
l.v = g
l.z = g
l.u = a
d.x = g
d.r = k
d.o = e
e.w = l
assert a.z.q.v.v.r.w.r.w.r.txt == "j"