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

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

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

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

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

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

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

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

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

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

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

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

l.o = j
l.t = j
l.q = j
l.u = k
l.r = k
i.x = a
i.p = l
i.t = j
k.t = j
j.w = i
j.q = g
j.x = a
g.w = i
a.o = j
a.t = j
a.q = j
a.u = k
a.r = k
assert j.x.t.q.txt == "g"