class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: E = None
        self.o: C = None
        self.p: B = None
        self.r: D = None
        self.s: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: A = None
        self.w: A = None
        self.s: E = None
        self.t: A = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

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

j = A("j")
c = B("c")
k = C("k")
i = D("i")
f = E("f")
n = F("n")

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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: A = None
        self.w: A = None
        self.s: E = None
        self.t: A = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

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

j = A("j")
c = B("c")
k = C("k")
i = D("i")
f = E("f")
n = F("n")

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