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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: A = None
        self.v: E = None
        self.txt = txt

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

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

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

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

k.w = h
k.y = d
d.p = j
d.v = j
d.x = a
i.w = h
l.y = i
l.q = j
l.w = j
l.u = h
j.o = a
b.y = i
b.q = j
b.w = j
b.u = h
a.w = k
a.y = d
h.w = a
h.y = d
n.y = i
n.q = j
n.w = j
n.u = a
assert n.u.y.x.txt == "
class A:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: A = None
        self.v: E = None
        self.txt = txt

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

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

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

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

k.w = h
k.y = d
d.p = j
d.v = j
d.x = a
i.w = h
l.y = i
l.q = j
l.w = j
l.u = h
j.o = a
b.y = i
b.q = j
b.w = j
b.u = h
a.w = k
a.y = d
h.w = a
h.y = d
n.y = i
n.q = j
n.w = j
n.u = a
assert n.u.y.x.txt == "a"