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

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

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

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

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

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

f.w = j
g.x = f
g.y = f
g.r = f
g.w = j
k.r = f
k.o = a
a.o = f
a.y = f
a.s = e
a.w = l
e.x = g
e.q = l
e.v = l
e.s = j
e.y = k
j.o = f
j.y = f
j.s = l
j.w = l
i.x = g
i.q = e
i.v = e
i.s = a
i.y = k
l.x = g
l.q = e
l.v = e
l.s = a
l.y = k
assert i.y.r.w.y.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

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

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

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

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

f.w = j
g.x = f
g.y = f
g.r = f
g.w = j
k.r = f
k.o = a
a.o = f
a.y = f
a.s = e
a.w = l
e.x = g
e.q = l
e.v = l
e.s = j
e.y = k
j.o = f
j.y = f
j.s = l
j.w = l
i.x = g
i.q = e
i.v = e
i.s = a
i.y = k
l.x = g
l.q = e
l.v = e
l.s = a
l.y = k
assert i.y.r.w.y.w.txt == "j"