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

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

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

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

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

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

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

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

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

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

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

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

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

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

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