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

class B:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: D = None
        self.u: D = None
        self.txt = txt

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

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

h = A("h")
l = B("l")
k = C("k")
j = D("j")
g = A("g")
e = B("e")
a = B("a")
d = B("d")
n = C("n")
m = A("m")

h.o = n
h.x = n
l.o = a
l.p = j
l.u = j
k.y = d
j.o = k
j.u = a
j.t = g
j.y = g
g.o = k
g.x = n
e.o = l
e.p = j
e.u = j
a.o = d
a.p = j
a.u = j
d.o = a
d.p = j
d.u = j
n.y = e
m.o = n
m.x = k
assert k.y.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: D = None
        self.u: D = None
        self.txt = txt

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

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

h = A("h")
l = B("l")
k = C("k")
j = D("j")
g = A("g")
e = B("e")
a = B("a")
d = B("d")
n = C("n")
m = A("m")

h.o = n
h.x = n
l.o = a
l.p = j
l.u = j
k.y = d
j.o = k
j.u = a
j.t = g
j.y = g
g.o = k
g.x = n
e.o = l
e.p = j
e.u = j
a.o = d
a.p = j
a.u = j
d.o = a
d.p = j
d.u = j
n.y = e
m.o = n
m.x = k
assert k.y.o.o.txt == "d"