class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.o: C = None
        self.r: G = None
        self.z: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: B = None
        self.y: B = None
        self.p: A = None
        self.u: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: F = None
        self.p: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: B = None
        self.y: B = None
        self.p: A = None
        self.u: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: F = None
        self.p: D = None
        self.txt = txt

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

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