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

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: B = None
        self.y: C = None
        self.q: A = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: B = None
        self.y: C = None
        self.q: A = None
        self.txt = txt

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

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

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

k.s = b
k.v = a
k.p = i
k.q = n
i.y = n
i.q = k
a.o = n
g.s = i
g.u = b
g.y = a
g.q = k
e.z = g
e.w = k
e.u = n
n.z = a
n.x = l
n.y = k
l.s = b
l.u = b
l.y = a
l.q = k
b.y = n
b.q = k
assert k.v.o.x.y.o.x.y.txt == "a"