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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: C = None
        self.x: E = None
        self.q: E = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: C = None
        self.x: E = None
        self.q: E = None
        self.txt = txt

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

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

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

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

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

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