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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

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

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