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

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

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

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

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

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

i.r = l
i.u = d
i.s = d
i.q = b
i.v = f
f.u = b
f.y = b
f.p = d
f.z = l
m.v = n
m.q = g
d.x = l
d.w = f
d.v = n
n.v = l
n.q = l
b.v = n
b.q = i
l.v = n
l.q = n
g.r = l
g.u = d
g.s = d
g.q = m
g.v = f
assert d.w.p.w.y.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: D = None
        self.s: D = None
        self.q: C = None
        self.v: B = None
        self.txt = txt

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

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

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

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

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

i.r = l
i.u = d
i.s = d
i.q = b
i.v = f
f.u = b
f.y = b
f.p = d
f.z = l
m.v = n
m.q = g
d.x = l
d.w = f
d.v = n
n.v = l
n.q = l
b.v = n
b.q = i
l.v = n
l.q = n
g.r = l
g.u = d
g.s = d
g.q = m
g.v = f
assert d.w.p.w.y.txt == "b"