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

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

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

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

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

c = A("c")
a = B("a")
h = C("h")
g = D("g")
b = E("b")
l = C("l")
f = D("f")
j = E("j")
i = A("i")

c.p = g
c.r = g
c.z = a
a.q = h
a.p = h
h.q = j
h.p = j
h.y = i
h.x = g
h.u = f
g.z = l
g.w = b
g.p = h
b.v = h
b.p = a
b.t = a
l.q = b
l.p = b
l.y = c
l.x = f
l.u = f
f.z = h
f.p = h
f.w = j
j.v = h
j.p = a
j.t = a
i.p = g
i.r = g
i.z = a
assert f.p.p.v.u.w.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: B = None
        self.r: D = None
        self.txt = txt

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

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

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

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

c = A("c")
a = B("a")
h = C("h")
g = D("g")
b = E("b")
l = C("l")
f = D("f")
j = E("j")
i = A("i")

c.p = g
c.r = g
c.z = a
a.q = h
a.p = h
h.q = j
h.p = j
h.y = i
h.x = g
h.u = f
g.z = l
g.w = b
g.p = h
b.v = h
b.p = a
b.t = a
l.q = b
l.p = b
l.y = c
l.x = f
l.u = f
f.z = h
f.p = h
f.w = j
j.v = h
j.p = a
j.t = a
i.p = g
i.r = g
i.z = a
assert f.p.p.v.u.w.txt == "j"