class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.t: B = None
        self.z: D = None
        self.p: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: D = None
        self.t: E = None
        self.s: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: C = None
        self.v: B = None
        self.txt = txt

g = A("g")
i = B("i")
e = C("e")
f = D("f")
a = E("a")
m = B("m")
c = A("c")
n = D("n")
j = C("j")
l = B("l")

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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: D = None
        self.t: E = None
        self.s: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: C = None
        self.v: B = None
        self.txt = txt

g = A("g")
i = B("i")
e = C("e")
f = D("f")
a = E("a")
m = B("m")
c = A("c")
n = D("n")
j = C("j")
l = B("l")

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