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

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

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

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

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

n = A("n")
g = B("g")
f = C("f")
j = D("j")
b = E("b")
k = B("k")
e = E("e")
i = C("i")

n.y = e
g.p = b
g.y = e
g.u = e
g.r = j
f.t = b
f.y = j
j.o = e
j.s = n
b.v = f
b.s = e
b.y = e
b.q = i
k.p = e
k.y = e
k.u = e
k.r = j
e.v = f
e.s = b
e.y = b
e.q = i
i.t = e
i.y = j
assert e.v.y.o.q.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

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

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

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

n = A("n")
g = B("g")
f = C("f")
j = D("j")
b = E("b")
k = B("k")
e = E("e")
i = C("i")

n.y = e
g.p = b
g.y = e
g.u = e
g.r = j
f.t = b
f.y = j
j.o = e
j.s = n
b.v = f
b.s = e
b.y = e
b.q = i
k.p = e
k.y = e
k.u = e
k.r = j
e.v = f
e.s = b
e.y = b
e.q = i
i.t = e
i.y = j
assert e.v.y.o.q.txt == "i"