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

class B:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: C = None
        self.y: B = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: A = None
        self.u: E = None
        self.w: B = None
        self.txt = txt

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

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

g = A("g")
j = B("j")
k = C("k")
l = D("l")
m = E("m")
a = D("a")
c = E("c")
d = B("d")

g.o = a
g.u = c
g.r = c
j.o = d
j.y = d
j.r = k
j.p = l
k.y = c
k.q = g
k.u = m
k.w = j
l.x = c
l.u = c
l.s = d
l.w = k
m.y = c
m.t = a
m.s = k
m.x = l
a.x = c
a.u = c
a.s = j
a.w = k
c.y = m
c.t = l
c.s = k
c.x = a
d.o = j
d.y = j
d.r = k
d.p = a
assert c.s.w.p.s.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: E = None
        self.r: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: C = None
        self.y: B = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: A = None
        self.u: E = None
        self.w: B = None
        self.txt = txt

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

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

g = A("g")
j = B("j")
k = C("k")
l = D("l")
m = E("m")
a = D("a")
c = E("c")
d = B("d")

g.o = a
g.u = c
g.r = c
j.o = d
j.y = d
j.r = k
j.p = l
k.y = c
k.q = g
k.u = m
k.w = j
l.x = c
l.u = c
l.s = d
l.w = k
m.y = c
m.t = a
m.s = k
m.x = l
a.x = c
a.u = c
a.s = j
a.w = k
c.y = m
c.t = l
c.s = k
c.x = a
d.o = j
d.y = j
d.r = k
d.p = a
assert c.s.w.p.s.txt == "d"