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

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

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

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

i = A("i")
g = B("g")
e = C("e")
c = D("c")
a = A("a")
j = A("j")
n = C("n")
m = B("m")
l = B("l")
f = D("f")

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

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

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

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

i = A("i")
g = B("g")
e = C("e")
c = D("c")
a = A("a")
j = A("j")
n = C("n")
m = B("m")
l = B("l")
f = D("f")

i.q = n
i.w = n
i.s = n
i.t = a
g.x = m
g.r = c
e.r = n
e.y = f
e.v = j
e.w = c
c.p = e
c.y = n
a.q = e
a.w = e
a.s = e
a.t = j
j.q = e
j.w = e
j.t = a
j.s = n
n.r = e
n.y = c
n.v = j
n.w = f
m.x = l
m.r = f
l.x = g
l.r = f
f.p = e
f.y = n
assert j.w.w.p.w.y.y.p.y.p.txt == "e"