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

class B:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: E = None
        self.q: C = None
        self.v: B = None
        self.u: E = None
        self.txt = txt

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

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

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

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

j.q = h
b.t = n
b.v = n
b.s = h
b.u = h
b.q = l
l.y = h
k.q = l
k.o = d
k.t = h
k.p = b
k.y = j
h.o = b
h.u = n
h.r = l
n.t = b
n.v = b
n.s = h
n.u = h
n.q = l
d.q = l
d.o = k
d.t = h
d.p = b
d.y = j
assert j.q.u.v.v.q.y.u.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: E = None
        self.q: C = None
        self.v: B = None
        self.u: E = None
        self.txt = txt

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

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

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

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

j.q = h
b.t = n
b.v = n
b.s = h
b.u = h
b.q = l
l.y = h
k.q = l
k.o = d
k.t = h
k.p = b
k.y = j
h.o = b
h.u = n
h.r = l
n.t = b
n.v = b
n.s = h
n.u = h
n.q = l
d.q = l
d.o = k
d.t = h
d.p = b
d.y = j
assert j.q.u.v.v.q.y.u.txt == "n"