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

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

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

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

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

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

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

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

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

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

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

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

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

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

d.z = k
d.s = l
d.u = n
d.t = c
d.y = c
d.q = g
l.o = g
l.x = g
l.q = k
l.v = d
l.u = c
n.t = l
n.u = l
n.s = l
g.s = k
c.v = l
c.t = n
k.q = g
k.r = c
assert k.q.s.r.v.o.s.txt == "k"