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

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

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

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

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

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

l = A("l")
d = B("d")
h = C("h")
k = D("k")
j = E("j")
c = F("c")

l.s = k
l.r = k
l.t = j
l.v = j
l.y = c
d.r = h
d.t = j
h.p = c
k.x = c
k.o = c
k.z = c
k.t = l
j.p = c
j.s = k
j.o = l
c.t = k
c.z = k
c.r = d
c.s = d
assert k.z.s.r.p.z.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: D = None
        self.t: E = None
        self.v: E = None
        self.y: F = None
        self.txt = txt

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

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

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

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

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

l = A("l")
d = B("d")
h = C("h")
k = D("k")
j = E("j")
c = F("c")

l.s = k
l.r = k
l.t = j
l.v = j
l.y = c
d.r = h
d.t = j
h.p = c
k.x = c
k.o = c
k.z = c
k.t = l
j.p = c
j.s = k
j.o = l
c.t = k
c.z = k
c.r = d
c.s = d
assert k.z.s.r.p.z.txt == "k"