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

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

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

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

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

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

l.u = e
l.z = b
l.p = d
f.v = i
f.s = j
f.p = l
i.o = d
i.x = d
b.q = n
b.t = l
n.w = l
n.s = i
d.o = i
d.x = i
e.u = l
e.z = b
e.p = d
j.v = d
j.s = f
j.p = e
assert j.v.o.x.txt == "
class A:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: D = None
        self.p: C = None
        self.txt = txt

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

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

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

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

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

l.u = e
l.z = b
l.p = d
f.v = i
f.s = j
f.p = l
i.o = d
i.x = d
b.q = n
b.t = l
n.w = l
n.s = i
d.o = i
d.x = i
e.u = l
e.z = b
e.p = d
j.v = d
j.s = f
j.p = e
assert j.v.o.x.txt == "d"