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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: E = None
        self.q: D = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: C = None
        self.u: B = None
        self.w: C = None
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: E = None
        self.x: A = None
        self.t: C = None
        self.txt = txt

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

j = A("j")
n = B("n")
f = C("f")
k = D("k")
e = E("e")
d = B("d")
c = C("c")
i = C("i")

j.r = e
n.x = e
n.w = e
n.o = e
n.q = k
f.r = j
f.y = i
f.w = i
f.u = n
f.s = k
k.v = j
k.x = j
k.r = e
k.t = i
e.w = n
e.s = n
d.x = e
d.w = e
d.o = e
d.q = k
c.r = j
c.y = f
c.w = f
c.u = d
c.s = k
i.r = j
i.y = f
i.u = d
i.w = c
i.s = k
assert i.w.u.q.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: E = None
        self.q: D = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: C = None
        self.u: B = None
        self.w: C = None
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: E = None
        self.x: A = None
        self.t: C = None
        self.txt = txt

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

j = A("j")
n = B("n")
f = C("f")
k = D("k")
e = E("e")
d = B("d")
c = C("c")
i = C("i")

j.r = e
n.x = e
n.w = e
n.o = e
n.q = k
f.r = j
f.y = i
f.w = i
f.u = n
f.s = k
k.v = j
k.x = j
k.r = e
k.t = i
e.w = n
e.s = n
d.x = e
d.w = e
d.o = e
d.q = k
c.r = j
c.y = f
c.w = f
c.u = d
c.s = k
i.r = j
i.y = f
i.u = d
i.w = c
i.s = k
assert i.w.u.q.txt == "k"