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

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

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

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

l = A("l")
j = B("j")
e = C("e")
c = D("c")
h = B("h")
a = A("a")
f = A("f")
i = C("i")
k = B("k")

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

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

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

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

l = A("l")
j = B("j")
e = C("e")
c = D("c")
h = B("h")
a = A("a")
f = A("f")
i = C("i")
k = B("k")

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