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

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: B = None
        self.w: B = None
        self.t: F = None
        self.r: E = None
        self.p: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: A = None
        self.s: B = None
        self.txt = txt

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

i = A("i")
f = B("f")
n = C("n")
e = D("e")
k = E("k")
g = F("g")

i.r = n
i.z = n
i.x = k
i.y = g
i.u = g
f.z = e
f.w = k
f.q = k
n.q = g
n.t = g
n.p = g
n.s = f
n.w = f
n.r = k
e.q = f
e.u = i
k.o = i
k.r = i
k.s = f
g.v = e
g.r = k
g.y = f
g.w = f
g.p = f
assert n.r.s.z.q.w.s.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: E = None
        self.y: F = None
        self.z: C = None
        self.u: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: B = None
        self.w: B = None
        self.t: F = None
        self.r: E = None
        self.p: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: A = None
        self.s: B = None
        self.txt = txt

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

i = A("i")
f = B("f")
n = C("n")
e = D("e")
k = E("k")
g = F("g")

i.r = n
i.z = n
i.x = k
i.y = g
i.u = g
f.z = e
f.w = k
f.q = k
n.q = g
n.t = g
n.p = g
n.s = f
n.w = f
n.r = k
e.q = f
e.u = i
k.o = i
k.r = i
k.s = f
g.v = e
g.r = k
g.y = f
g.w = f
g.p = f
assert n.r.s.z.q.w.s.txt == "f"