class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: F = None
        self.v: C = None
        self.o: D = None
        self.w: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.x: A = None
        self.w: D = None
        self.txt = txt

c = A("c")
d = B("d")
k = C("k")
m = D("m")
e = E("e")
j = F("j")

c.z = m
c.o = m
c.t = j
c.v = k
c.w = d
d.s = k
d.z = e
k.q = e
m.o = d
m.x = j
m.s = j
m.y = k
m.p = k
e.w = k
j.v = m
j.w = m
j.x = c
assert c.v.q.w.q.w.q.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: F = None
        self.v: C = None
        self.o: D = None
        self.w: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.x: A = None
        self.w: D = None
        self.txt = txt

c = A("c")
d = B("d")
k = C("k")
m = D("m")
e = E("e")
j = F("j")

c.z = m
c.o = m
c.t = j
c.v = k
c.w = d
d.s = k
d.z = e
k.q = e
m.o = d
m.x = j
m.s = j
m.y = k
m.p = k
e.w = k
j.v = m
j.w = m
j.x = c
assert c.v.q.w.q.w.q.txt == "e"