class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.w: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.r: C = None
        self.v: C = None
        self.w: E = None
        self.t: E = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: B = None
        self.u: D = None
        self.v: C = None
        self.txt = txt

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

k = A("k")
e = B("e")
g = C("g")
d = D("d")
l = E("l")
m = F("m")

k.q = d
k.w = g
e.z = k
g.s = m
d.u = e
d.p = e
d.r = g
d.v = g
d.w = l
d.t = l
l.y = m
l.w = e
l.u = d
l.v = g
m.t = g
m.y = e
m.v = e
m.q = d
m.u = d
m.o = k
assert g.s.u.p.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.w: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.r: C = None
        self.v: C = None
        self.w: E = None
        self.t: E = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: B = None
        self.u: D = None
        self.v: C = None
        self.txt = txt

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

k = A("k")
e = B("e")
g = C("g")
d = D("d")
l = E("l")
m = F("m")

k.q = d
k.w = g
e.z = k
g.s = m
d.u = e
d.p = e
d.r = g
d.v = g
d.w = l
d.t = l
l.y = m
l.w = e
l.u = d
l.v = g
m.t = g
m.y = e
m.v = e
m.q = d
m.u = d
m.o = k
assert g.s.u.p.txt == "e"