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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: E = None
        self.x: C = None
        self.y: B = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: E = None
        self.x: C = None
        self.y: B = None
        self.txt = txt

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

l.r = h
l.x = h
l.w = i
l.u = i
j.r = d
j.w = a
j.u = l
j.t = e
k.o = e
k.q = g
i.s = l
i.t = h
d.t = a
d.x = k
d.y = j
h.s = l
h.t = i
a.t = d
a.x = e
a.y = j
e.o = k
e.q = j
g.r = d
g.w = a
g.u = l
g.t = e
assert e.q.w.x.txt == "e"