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

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

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

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

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

n = A("n")
a = B("a")
e = C("e")
b = D("b")
k = E("k")
f = C("f")
c = A("c")
i = B("i")
h = D("h")

n.y = b
n.u = b
n.q = h
a.x = n
e.u = f
e.w = f
e.v = f
e.p = b
e.y = n
b.r = c
b.v = h
b.s = h
b.q = k
k.v = a
f.u = e
f.w = e
f.v = e
f.p = h
f.y = c
c.y = b
c.u = b
c.q = b
i.x = c
h.r = c
h.v = b
h.s = b
h.q = k
assert e.p.s.q.v.x.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: D = None
        self.q: D = None
        self.txt = txt

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

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

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

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

n = A("n")
a = B("a")
e = C("e")
b = D("b")
k = E("k")
f = C("f")
c = A("c")
i = B("i")
h = D("h")

n.y = b
n.u = b
n.q = h
a.x = n
e.u = f
e.w = f
e.v = f
e.p = b
e.y = n
b.r = c
b.v = h
b.s = h
b.q = k
k.v = a
f.u = e
f.w = e
f.v = e
f.p = h
f.y = c
c.y = b
c.u = b
c.q = b
i.x = c
h.r = c
h.v = b
h.s = b
h.q = k
assert e.p.s.q.v.x.q.q.txt == "k"