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

class B:
    def __init__(self, txt: str):
        self.q: E = 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.u: C = None
        self.w: E = None
        self.r: A = None
        self.x: E = None
        self.txt = txt

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

f = A("f")
e = B("e")
k = C("k")
l = D("l")
n = E("n")
j = E("j")

f.r = j
f.y = l
f.x = l
f.o = e
f.t = k
e.q = n
e.t = l
k.t = l
l.u = k
l.w = n
l.x = n
l.r = f
n.s = e
n.u = f
n.y = l
j.s = e
j.u = f
j.y = l
assert e.t.r.r.u.t.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.y: D = None
        self.o: B = None
        self.x: D = None
        self.t: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: E = 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.u: C = None
        self.w: E = None
        self.r: A = None
        self.x: E = None
        self.txt = txt

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

f = A("f")
e = B("e")
k = C("k")
l = D("l")
n = E("n")
j = E("j")

f.r = j
f.y = l
f.x = l
f.o = e
f.t = k
e.q = n
e.t = l
k.t = l
l.u = k
l.w = n
l.x = n
l.r = f
n.s = e
n.u = f
n.y = l
j.s = e
j.u = f
j.y = l
assert e.t.r.r.u.t.txt == "k"