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

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

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

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

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

b = A("b")
a = B("a")
l = C("l")
i = D("i")
n = E("n")
g = D("g")
j = A("j")

b.w = g
b.p = n
b.y = a
b.v = l
b.r = l
a.u = l
a.y = n
a.r = j
l.x = i
l.p = b
i.v = n
i.p = a
i.s = j
i.o = l
n.v = l
g.v = n
g.p = a
g.s = j
g.o = l
j.w = g
j.p = n
j.y = a
j.v = l
j.r = l
assert g.s.w.p.r.r.x.p.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: E = None
        self.y: B = None
        self.v: C = None
        self.r: C = None
        self.txt = txt

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

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

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

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

b = A("b")
a = B("a")
l = C("l")
i = D("i")
n = E("n")
g = D("g")
j = A("j")

b.w = g
b.p = n
b.y = a
b.v = l
b.r = l
a.u = l
a.y = n
a.r = j
l.x = i
l.p = b
i.v = n
i.p = a
i.s = j
i.o = l
n.v = l
g.v = n
g.p = a
g.s = j
g.o = l
j.w = g
j.p = n
j.y = a
j.v = l
j.r = l
assert g.s.w.p.r.r.x.p.txt == "a"