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

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: E = None
        self.u: B = None
        self.y: A = None
        self.txt = txt

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

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

l = A("l")
g = B("g")
k = C("k")
n = D("n")
j = E("j")
d = E("d")
m = B("m")

l.o = d
g.u = k
g.s = d
g.y = n
g.v = l
k.t = l
k.y = l
k.x = j
k.u = g
n.q = k
n.v = k
n.x = l
n.z = j
n.u = d
j.v = d
j.s = d
j.p = l
j.u = l
j.q = l
d.v = j
d.s = j
d.p = l
d.u = l
d.q = l
m.u = k
m.s = j
m.y = n
m.v = l
assert l.o.u.o.v.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: E = None
        self.u: B = None
        self.y: A = None
        self.txt = txt

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

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

l = A("l")
g = B("g")
k = C("k")
n = D("n")
j = E("j")
d = E("d")
m = B("m")

l.o = d
g.u = k
g.s = d
g.y = n
g.v = l
k.t = l
k.y = l
k.x = j
k.u = g
n.q = k
n.v = k
n.x = l
n.z = j
n.u = d
j.v = d
j.s = d
j.p = l
j.u = l
j.q = l
d.v = j
d.s = j
d.p = l
d.u = l
d.q = l
m.u = k
m.s = j
m.y = n
m.v = l
assert l.o.u.o.v.txt == "j"