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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.q: F = None
        self.o: D = None
        self.p: F = None
        self.s: C = None
        self.y: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: D = None
        self.q: C = None
        self.w: D = None
        self.txt = txt

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

b = A("b")
a = B("a")
j = C("j")
k = D("k")
i = E("i")
e = F("e")

b.z = a
a.w = j
a.s = j
a.y = j
a.q = e
a.p = e
a.o = k
j.s = i
j.y = b
k.r = b
k.w = i
k.x = a
k.q = j
k.t = j
i.z = a
i.o = k
i.w = k
i.q = j
e.r = i
assert k.t.y.z.q.r.o.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.q: F = None
        self.o: D = None
        self.p: F = None
        self.s: C = None
        self.y: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: D = None
        self.q: C = None
        self.w: D = None
        self.txt = txt

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

b = A("b")
a = B("a")
j = C("j")
k = D("k")
i = E("i")
e = F("e")

b.z = a
a.w = j
a.s = j
a.y = j
a.q = e
a.p = e
a.o = k
j.s = i
j.y = b
k.r = b
k.w = i
k.x = a
k.q = j
k.t = j
i.z = a
i.o = k
i.w = k
i.q = j
e.r = i
assert k.t.y.z.q.r.o.txt == "k"