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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: A = None
        self.r: C = None
        self.s: C = None
        self.txt = txt

d = A("d")
j = B("j")
a = C("a")
c = D("c")
i = E("i")
e = B("e")
k = A("k")
b = C("b")

d.q = c
d.s = j
d.u = i
d.p = a
d.v = k
j.z = c
j.p = c
j.u = e
a.v = b
c.s = i
c.r = i
c.o = j
c.p = e
i.o = e
i.t = d
i.r = b
i.s = a
e.z = c
e.p = c
e.u = j
k.q = c
k.s = e
k.u = i
k.p = b
k.v = d
b.v = a
assert j.p.r.s.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: B = None
        self.u: E = None
        self.p: C = None
        self.v: A = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: A = None
        self.r: C = None
        self.s: C = None
        self.txt = txt

d = A("d")
j = B("j")
a = C("a")
c = D("c")
i = E("i")
e = B("e")
k = A("k")
b = C("b")

d.q = c
d.s = j
d.u = i
d.p = a
d.v = k
j.z = c
j.p = c
j.u = e
a.v = b
c.s = i
c.r = i
c.o = j
c.p = e
i.o = e
i.t = d
i.r = b
i.s = a
e.z = c
e.p = c
e.u = j
k.q = c
k.s = e
k.u = i
k.p = b
k.v = d
b.v = a
assert j.p.r.s.txt == "a"