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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: D = None
        self.t: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: A = None
        self.q: A = None
        self.y: D = None
        self.w: C = None
        self.txt = txt

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

c.v = i
n.o = c
n.u = a
n.w = j
i.u = n
a.z = j
d.w = c
d.r = a
d.t = a
j.v = c
j.z = c
j.q = c
j.y = a
j.w = i
assert d.t.z.v.v.u.o.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: D = None
        self.t: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: A = None
        self.q: A = None
        self.y: D = None
        self.w: C = None
        self.txt = txt

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

c.v = i
n.o = c
n.u = a
n.w = j
i.u = n
a.z = j
d.w = c
d.r = a
d.t = a
j.v = c
j.z = c
j.q = c
j.y = a
j.w = i
assert d.t.z.v.v.u.o.txt == "c"