class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: E = None
        self.u: E = None
        self.z: E = None
        self.p: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: D = None
        self.txt = txt

h = A("h")
a = B("a")
f = C("f")
k = D("k")
m = E("m")
g = F("g")
i = E("i")

h.y = a
a.o = h
a.r = h
f.o = i
f.s = a
f.y = h
f.z = k
k.z = f
k.s = i
m.v = g
m.x = i
m.u = i
m.z = i
m.p = f
g.x = a
g.s = k
i.v = g
i.x = m
i.u = m
i.z = m
i.p = f
assert i.v.s.z.o.v.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: E = None
        self.u: E = None
        self.z: E = None
        self.p: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: D = None
        self.txt = txt

h = A("h")
a = B("a")
f = C("f")
k = D("k")
m = E("m")
g = F("g")
i = E("i")

h.y = a
a.o = h
a.r = h
f.o = i
f.s = a
f.y = h
f.z = k
k.z = f
k.s = i
m.v = g
m.x = i
m.u = i
m.z = i
m.p = f
g.x = a
g.s = k
i.v = g
i.x = m
i.u = m
i.z = m
i.p = f
assert i.v.s.z.o.v.txt == "g"