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

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

class C:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: D = None
        self.s: A = None
        self.r: D = None
        self.txt = txt

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

i = A("i")
e = B("e")
a = C("a")
f = D("f")
g = C("g")
n = B("n")
m = C("m")

i.v = f
i.p = f
i.o = f
i.u = n
e.z = f
e.y = a
e.w = n
e.s = i
a.u = g
a.y = f
a.r = f
a.s = i
f.q = i
f.z = g
f.r = e
f.s = m
g.u = a
g.y = f
g.r = f
g.s = i
n.z = f
n.y = m
n.w = e
n.s = i
m.u = g
m.y = f
m.r = f
m.s = i
assert g.s.u.z.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: D = None
        self.u: B = None
        self.o: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: D = None
        self.s: A = None
        self.r: D = None
        self.txt = txt

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

i = A("i")
e = B("e")
a = C("a")
f = D("f")
g = C("g")
n = B("n")
m = C("m")

i.v = f
i.p = f
i.o = f
i.u = n
e.z = f
e.y = a
e.w = n
e.s = i
a.u = g
a.y = f
a.r = f
a.s = i
f.q = i
f.z = g
f.r = e
f.s = m
g.u = a
g.y = f
g.r = f
g.s = i
n.z = f
n.y = m
n.w = e
n.s = i
m.u = g
m.y = f
m.r = f
m.s = i
assert g.s.u.z.txt == "f"