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

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

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

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

h = A("h")
k = B("k")
c = C("c")
e = D("e")
n = D("n")
j = A("j")
l = B("l")
i = D("i")
d = D("d")
b = D("b")

h.r = c
h.y = j
h.o = k
k.q = l
k.t = d
c.o = h
c.q = d
c.y = k
c.u = j
e.q = l
e.u = i
e.r = b
e.w = h
n.q = l
n.u = i
n.r = b
n.w = j
j.r = c
j.y = h
j.o = l
l.q = k
l.t = e
i.q = l
i.u = d
i.r = b
i.w = h
d.q = l
d.u = e
d.r = i
d.w = j
b.q = k
b.u = d
b.r = i
b.w = h
assert j.o.t.r.w.r.o.o.q.t.u.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: A = None
        self.o: B = None
        self.txt = txt

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

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

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

h = A("h")
k = B("k")
c = C("c")
e = D("e")
n = D("n")
j = A("j")
l = B("l")
i = D("i")
d = D("d")
b = D("b")

h.r = c
h.y = j
h.o = k
k.q = l
k.t = d
c.o = h
c.q = d
c.y = k
c.u = j
e.q = l
e.u = i
e.r = b
e.w = h
n.q = l
n.u = i
n.r = b
n.w = j
j.r = c
j.y = h
j.o = l
l.q = k
l.t = e
i.q = l
i.u = d
i.r = b
i.w = h
d.q = l
d.u = e
d.r = i
d.w = j
b.q = k
b.u = d
b.r = i
b.w = h
assert j.o.t.r.w.r.o.o.q.t.u.txt == "i"