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

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

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

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

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

j = A("j")
c = B("c")
h = C("h")
i = D("i")
k = E("k")
a = A("a")
g = C("g")
f = C("f")

j.p = c
j.x = a
c.x = h
c.v = j
c.r = j
c.w = i
h.z = k
h.q = k
h.v = k
h.u = a
i.x = h
i.t = c
i.y = c
i.o = g
i.s = a
k.y = j
k.u = f
k.x = f
k.v = i
a.p = c
a.x = j
g.z = k
g.q = k
g.v = k
g.u = j
f.z = k
f.q = k
f.v = k
f.u = j
assert c.w.s.p.r.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: A = None
        self.txt = txt

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

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

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

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

j = A("j")
c = B("c")
h = C("h")
i = D("i")
k = E("k")
a = A("a")
g = C("g")
f = C("f")

j.p = c
j.x = a
c.x = h
c.v = j
c.r = j
c.w = i
h.z = k
h.q = k
h.v = k
h.u = a
i.x = h
i.t = c
i.y = c
i.o = g
i.s = a
k.y = j
k.u = f
k.x = f
k.v = i
a.p = c
a.x = j
g.z = k
g.q = k
g.v = k
g.u = j
f.z = k
f.q = k
f.v = k
f.u = j
assert c.w.s.p.r.txt == "j"