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

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

e = A("e")
m = B("m")
l = C("l")
k = D("k")
g = B("g")
a = B("a")
f = A("f")
c = C("c")
b = D("b")
i = A("i")

e.w = m
e.q = a
e.r = i
m.v = i
m.u = b
m.w = c
l.y = b
k.x = l
k.w = f
k.r = b
g.v = f
g.u = k
g.w = l
a.v = e
a.u = k
a.w = c
f.w = g
f.q = a
f.r = i
c.y = b
b.x = c
b.w = e
b.r = k
i.w = g
i.q = g
i.r = f
assert m.w.y.w.w.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: B = None
        self.r: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

e = A("e")
m = B("m")
l = C("l")
k = D("k")
g = B("g")
a = B("a")
f = A("f")
c = C("c")
b = D("b")
i = A("i")

e.w = m
e.q = a
e.r = i
m.v = i
m.u = b
m.w = c
l.y = b
k.x = l
k.w = f
k.r = b
g.v = f
g.u = k
g.w = l
a.v = e
a.u = k
a.w = c
f.w = g
f.q = a
f.r = i
c.y = b
b.x = c
b.w = e
b.r = k
i.w = g
i.q = g
i.r = f
assert m.w.y.w.w.u.txt == "b"