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

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

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: B = None
        self.t: C = None
        self.w: A = None
        self.txt = txt

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

j = A("j")
k = B("k")
n = C("n")
f = D("f")
d = E("d")
b = E("b")
i = C("i")
g = D("g")

j.q = i
j.u = k
j.t = k
j.x = d
j.o = f
k.q = b
n.w = f
n.s = j
f.s = d
f.z = k
f.t = n
f.w = j
d.s = j
d.p = g
b.s = j
b.p = f
i.w = g
i.s = j
g.s = d
g.z = k
g.t = n
g.w = j
assert g.s.p.w.q.w.t.s.t.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: B = None
        self.x: E = None
        self.o: D = None
        self.t: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: B = None
        self.t: C = None
        self.w: A = None
        self.txt = txt

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

j = A("j")
k = B("k")
n = C("n")
f = D("f")
d = E("d")
b = E("b")
i = C("i")
g = D("g")

j.q = i
j.u = k
j.t = k
j.x = d
j.o = f
k.q = b
n.w = f
n.s = j
f.s = d
f.z = k
f.t = n
f.w = j
d.s = j
d.p = g
b.s = j
b.p = f
i.w = g
i.s = j
g.s = d
g.z = k
g.t = n
g.w = j
assert g.s.p.w.q.w.t.s.t.txt == "k"