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

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

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: E = None
        self.u: D = None
        self.txt = txt

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

j = A("j")
k = B("k")
h = C("h")
g = D("g")
a = E("a")
e = D("e")
b = E("b")
n = A("n")

j.y = g
j.p = g
j.u = n
j.v = k
j.q = k
k.p = h
k.q = n
k.t = e
h.o = b
g.t = j
g.s = a
g.u = e
a.y = n
a.x = g
a.u = k
a.t = h
e.t = j
e.s = a
e.u = g
b.y = n
b.x = g
b.u = k
b.t = h
n.y = g
n.u = j
n.v = k
n.q = k
n.p = e
assert n.q.t.u.u.t.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: A = None
        self.v: B = None
        self.p: D = None
        self.q: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: E = None
        self.u: D = None
        self.txt = txt

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

j = A("j")
k = B("k")
h = C("h")
g = D("g")
a = E("a")
e = D("e")
b = E("b")
n = A("n")

j.y = g
j.p = g
j.u = n
j.v = k
j.q = k
k.p = h
k.q = n
k.t = e
h.o = b
g.t = j
g.s = a
g.u = e
a.y = n
a.x = g
a.u = k
a.t = h
e.t = j
e.s = a
e.u = g
b.y = n
b.x = g
b.u = k
b.t = h
n.y = g
n.u = j
n.v = k
n.q = k
n.p = e
assert n.q.t.u.u.t.txt == "j"