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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: F = None
        self.w: E = None
        self.x: E = None
        self.t: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: A = None
        self.p: B = None
        self.r: E = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.t: A = None
        self.y: D = None
        self.q: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: E = None
        self.r: E = None
        self.u: A = None
        self.txt = txt

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

k.o = d
k.z = c
h.w = k
h.t = l
h.s = b
d.q = k
d.z = b
d.w = c
d.x = c
d.t = l
l.o = c
l.r = c
l.t = k
l.p = h
l.y = h
c.o = b
c.t = k
c.y = l
c.q = l
b.x = d
b.t = c
b.r = c
b.u = k
assert h.t.y.s.r.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.z: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: F = None
        self.w: E = None
        self.x: E = None
        self.t: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: A = None
        self.p: B = None
        self.r: E = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.t: A = None
        self.y: D = None
        self.q: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: E = None
        self.r: E = None
        self.u: A = None
        self.txt = txt

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

k.o = d
k.z = c
h.w = k
h.t = l
h.s = b
d.q = k
d.z = b
d.w = c
d.x = c
d.t = l
l.o = c
l.r = c
l.t = k
l.p = h
l.y = h
c.o = b
c.t = k
c.y = l
c.q = l
b.x = d
b.t = c
b.r = c
b.u = k
assert h.t.y.s.r.txt == "c"