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

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

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

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

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

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

l.r = g
l.w = g
g.x = i
g.t = i
g.s = b
g.v = l
d.p = j
d.s = g
j.v = f
j.z = g
b.z = j
b.p = f
f.p = j
f.s = i
i.x = g
i.t = g
i.s = b
i.v = l
assert l.w.v.w.s.p.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: B = None
        self.txt = txt

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

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

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

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

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

l.r = g
l.w = g
g.x = i
g.t = i
g.s = b
g.v = l
d.p = j
d.s = g
j.v = f
j.z = g
b.z = j
b.p = f
f.p = j
f.s = i
i.x = g
i.t = g
i.s = b
i.v = l
assert l.w.v.w.s.p.s.s.txt == "b"