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

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

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

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

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

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

i.v = j
i.r = f
i.u = f
g.u = l
g.p = h
j.p = n
j.v = l
j.u = f
l.v = i
l.u = h
h.o = l
h.v = f
h.q = j
h.y = i
h.z = i
a.u = l
a.p = n
n.o = l
n.v = i
n.q = j
n.y = f
n.z = f
m.u = l
m.p = h
f.v = j
f.r = i
f.u = i
assert a.p.z.u.v.v.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: A = None
        self.u: A = None
        self.txt = txt

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

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

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

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

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

i.v = j
i.r = f
i.u = f
g.u = l
g.p = h
j.p = n
j.v = l
j.u = f
l.v = i
l.u = h
h.o = l
h.v = f
h.q = j
h.y = i
h.z = i
a.u = l
a.p = n
n.o = l
n.v = i
n.q = j
n.y = f
n.z = f
m.u = l
m.p = h
f.v = j
f.r = i
f.u = i
assert a.p.z.u.v.v.v.v.txt == "j"