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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: A = None
        self.w: C = None
        self.u: B = None
        self.s: C = None
        self.txt = txt

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

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

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

k = A("k")
g = B("g")
i = C("i")
c = D("c")
d = E("d")
j = B("j")
h = A("h")
f = E("f")
e = A("e")
n = C("n")

k.y = d
k.u = f
k.w = f
k.r = h
g.y = h
g.x = e
g.w = n
g.s = n
g.u = j
i.w = g
c.w = d
d.t = c
d.q = c
d.y = j
j.y = h
j.x = e
j.w = n
j.u = g
j.s = i
h.y = f
h.u = f
h.w = d
h.r = e
f.t = c
f.q = c
f.y = j
e.y = f
e.w = f
e.u = d
e.r = h
n.w = g
assert j.x.r.r.u.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.u: E = None
        self.w: E = None
        self.r: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: A = None
        self.w: C = None
        self.u: B = None
        self.s: C = None
        self.txt = txt

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

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

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

k = A("k")
g = B("g")
i = C("i")
c = D("c")
d = E("d")
j = B("j")
h = A("h")
f = E("f")
e = A("e")
n = C("n")

k.y = d
k.u = f
k.w = f
k.r = h
g.y = h
g.x = e
g.w = n
g.s = n
g.u = j
i.w = g
c.w = d
d.t = c
d.q = c
d.y = j
j.y = h
j.x = e
j.w = n
j.u = g
j.s = i
h.y = f
h.u = f
h.w = d
h.r = e
f.t = c
f.q = c
f.y = j
e.y = f
e.w = f
e.u = d
e.r = h
n.w = g
assert j.x.r.r.u.txt == "d"