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

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

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

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

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

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

a.s = j
a.r = j
a.t = i
a.v = b
a.w = f
e.t = i
b.q = d
b.z = l
j.s = i
f.r = a
i.s = j
i.r = j
i.t = a
i.v = l
i.w = g
l.q = d
l.z = b
k.r = a
g.r = i
d.t = a
assert k.r.v.z.q.t.v.q.t.v.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.t: A = None
        self.v: C = None
        self.r: D = None
        self.w: E = None
        self.txt = txt

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

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

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

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

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

a.s = j
a.r = j
a.t = i
a.v = b
a.w = f
e.t = i
b.q = d
b.z = l
j.s = i
f.r = a
i.s = j
i.r = j
i.t = a
i.v = l
i.w = g
l.q = d
l.z = b
k.r = a
g.r = i
d.t = a
assert k.r.v.z.q.t.v.q.t.v.txt == "b"