class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: F = None
        self.x: E = None
        self.q: B = None
        self.y: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: F = None
        self.t: E = None
        self.p: E = None
        self.r: B = None
        self.v: A = None
        self.txt = txt

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

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

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

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

k.v = n
k.q = n
k.o = d
k.y = d
k.x = e
n.q = g
n.o = g
g.z = d
g.q = d
g.t = e
g.p = e
g.r = n
g.v = k
b.y = k
b.z = k
e.o = c
e.x = c
e.v = g
e.r = b
e.z = n
d.v = n
c.y = k
c.z = k
assert k.v.o.r.q.p.r.y.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: F = None
        self.x: E = None
        self.q: B = None
        self.y: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: F = None
        self.t: E = None
        self.p: E = None
        self.r: B = None
        self.v: A = None
        self.txt = txt

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

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

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

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

k.v = n
k.q = n
k.o = d
k.y = d
k.x = e
n.q = g
n.o = g
g.z = d
g.q = d
g.t = e
g.p = e
g.r = n
g.v = k
b.y = k
b.z = k
e.o = c
e.x = c
e.v = g
e.r = b
e.z = n
d.v = n
c.y = k
c.z = k
assert k.v.o.r.q.p.r.y.txt == "k"