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

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

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

l = A("l")
n = B("n")
e = C("e")
a = C("a")
c = C("c")
d = B("d")
g = B("g")
j = A("j")

l.s = j
l.p = j
l.x = j
n.r = j
e.w = g
e.v = l
e.y = j
a.w = g
a.v = l
a.y = j
c.w = n
c.v = j
c.y = l
d.r = l
g.r = l
j.s = l
j.p = l
j.x = l
assert g.r.p.x.p.p.s.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: A = None
        self.x: A = None
        self.txt = txt

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

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

l = A("l")
n = B("n")
e = C("e")
a = C("a")
c = C("c")
d = B("d")
g = B("g")
j = A("j")

l.s = j
l.p = j
l.x = j
n.r = j
e.w = g
e.v = l
e.y = j
a.w = g
a.v = l
a.y = j
c.w = n
c.v = j
c.y = l
d.r = l
g.r = l
j.s = l
j.p = l
j.x = l
assert g.r.p.x.p.p.s.s.s.txt == "j"