class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: E = None
        self.y: E = None
        self.q: C = None
        self.u: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.x: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: E = None
        self.y: D = None
        self.z: A = None
        self.o: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.p: G = None
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

f.v = e
f.q = e
f.p = d
f.y = b
f.u = i
m.p = h
m.x = f
e.r = f
e.z = f
e.p = b
e.o = b
e.y = a
a.o = m
b.z = i
b.p = n
b.q = e
i.p = e
i.y = m
n.o = f
h.o = f
d.z = i
d.p = h
d.q = e
assert f.v.y.o.x.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: E = None
        self.y: E = None
        self.q: C = None
        self.u: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.x: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: E = None
        self.y: D = None
        self.z: A = None
        self.o: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.p: G = None
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

f.v = e
f.q = e
f.p = d
f.y = b
f.u = i
m.p = h
m.x = f
e.r = f
e.z = f
e.p = b
e.o = b
e.y = a
a.o = m
b.z = i
b.p = n
b.q = e
i.p = e
i.y = m
n.o = f
h.o = f
d.z = i
d.p = h
d.q = e
assert f.v.y.o.x.txt == "f"