class A:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: A = None
        self.q: C = None
        self.t: D = None
        self.z: B = None
        self.txt = txt

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

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

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

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

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

f.r = l
f.x = l
f.q = n
f.t = a
f.z = h
h.v = a
h.s = e
n.v = h
n.r = l
n.s = j
a.t = f
e.z = d
e.o = d
e.q = l
d.v = h
d.r = f
d.s = a
l.r = f
l.x = f
l.q = d
l.t = j
l.z = h
j.t = l
assert d.v.s.q.txt == "
class A:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: A = None
        self.q: C = None
        self.t: D = None
        self.z: B = None
        self.txt = txt

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

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

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

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

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

f.r = l
f.x = l
f.q = n
f.t = a
f.z = h
h.v = a
h.s = e
n.v = h
n.r = l
n.s = j
a.t = f
e.z = d
e.o = d
e.q = l
d.v = h
d.r = f
d.s = a
l.r = f
l.x = f
l.q = d
l.t = j
l.z = h
j.t = l
assert d.v.s.q.txt == "l"