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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: C = None
        self.s: D = None
        self.z: B = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: C = None
        self.s: D = None
        self.z: B = None
        self.txt = txt

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

f.t = b
f.w = b
f.y = g
f.s = n
f.q = l
n.q = b
n.v = b
n.p = l
l.r = k
l.x = d
g.t = i
g.s = i
g.q = d
g.p = n
g.z = l
k.q = n
k.z = n
k.v = l
k.s = g
i.t = f
i.y = g
i.s = n
i.w = b
i.q = l
b.t = f
b.w = f
b.y = g
b.s = n
b.q = l
d.t = b
d.q = g
d.p = n
d.s = f
d.z = l
assert g.p.p.r.s.p.q.s.q.txt == "b"