class A:
    def __init__(self, txt: str):
        self.y: A = None
        self.s: E = None
        self.p: D = None
        self.u: E = None
        self.r: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.y: F = None
        self.s: F = None
        self.txt = txt

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

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

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

d = A("d")
l = B("l")
j = C("j")
c = D("c")
f = E("f")
m = F("m")
a = E("a")
b = E("b")
i = B("i")
k = A("k")

d.y = k
d.s = f
d.p = c
d.u = a
d.r = m
l.v = i
l.t = j
l.r = m
j.u = a
j.y = m
j.s = m
c.q = f
c.o = m
c.s = j
f.r = c
f.z = k
m.z = l
a.r = c
a.z = d
b.r = c
b.z = d
i.v = l
i.t = j
i.r = m
k.y = d
k.s = a
k.p = c
k.u = b
k.r = m
assert a.z.p.q.z.txt == "
class A:
    def __init__(self, txt: str):
        self.y: A = None
        self.s: E = None
        self.p: D = None
        self.u: E = None
        self.r: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.y: F = None
        self.s: F = None
        self.txt = txt

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

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

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

d = A("d")
l = B("l")
j = C("j")
c = D("c")
f = E("f")
m = F("m")
a = E("a")
b = E("b")
i = B("i")
k = A("k")

d.y = k
d.s = f
d.p = c
d.u = a
d.r = m
l.v = i
l.t = j
l.r = m
j.u = a
j.y = m
j.s = m
c.q = f
c.o = m
c.s = j
f.r = c
f.z = k
m.z = l
a.r = c
a.z = d
b.r = c
b.z = d
i.v = l
i.t = j
i.r = m
k.y = d
k.s = a
k.p = c
k.u = b
k.r = m
assert a.z.p.q.z.txt == "k"