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

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: E = None
        self.txt = txt

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

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

c = A("c")
l = B("l")
d = C("d")
j = D("j")
a = E("a")
g = B("g")
f = A("f")

c.p = f
c.u = f
c.r = g
c.y = d
l.p = g
l.w = a
l.z = a
l.y = j
l.q = d
d.o = f
d.w = a
j.s = l
j.t = l
j.z = d
j.r = a
j.v = f
a.q = d
a.v = d
a.w = j
g.p = l
g.w = a
g.z = a
g.y = j
g.q = d
f.p = c
f.u = c
f.r = g
f.y = d
assert j.s.y.z.w.v.w.txt == "
class A:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: B = None
        self.y: C = None
        self.u: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: E = None
        self.txt = txt

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

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

c = A("c")
l = B("l")
d = C("d")
j = D("j")
a = E("a")
g = B("g")
f = A("f")

c.p = f
c.u = f
c.r = g
c.y = d
l.p = g
l.w = a
l.z = a
l.y = j
l.q = d
d.o = f
d.w = a
j.s = l
j.t = l
j.z = d
j.r = a
j.v = f
a.q = d
a.v = d
a.w = j
g.p = l
g.w = a
g.z = a
g.y = j
g.q = d
f.p = c
f.u = c
f.r = g
f.y = d
assert j.s.y.z.w.v.w.txt == "a"