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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: E = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: E = None
        self.txt = txt

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

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