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

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

class C:
    def __init__(self, txt: str):
        self.z: 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.o: F = None
        self.q: C = None
        self.w: B = None
        self.txt = txt

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

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

n.v = a
n.s = g
n.z = c
n.r = l
a.z = i
a.x = c
a.q = n
a.w = n
a.o = b
a.s = l
k.z = a
g.r = c
i.o = c
i.q = k
i.w = a
c.z = i
l.r = c
b.v = a
b.s = l
b.z = c
b.r = g
assert i.w.s.r.z.o.z.w.o.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: D = None
        self.z: F = None
        self.r: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: 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.o: F = None
        self.q: C = None
        self.w: B = None
        self.txt = txt

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

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

n.v = a
n.s = g
n.z = c
n.r = l
a.z = i
a.x = c
a.q = n
a.w = n
a.o = b
a.s = l
k.z = a
g.r = c
i.o = c
i.q = k
i.w = a
c.z = i
l.r = c
b.v = a
b.s = l
b.z = c
b.r = g
assert i.w.s.r.z.o.z.w.o.txt == "b"