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

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

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: D = None
        self.o: D = None
        self.s: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: A = None
        self.txt = txt

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

j.p = k
b.o = l
b.s = j
b.u = j
b.w = k
k.x = i
k.v = i
f.z = j
f.t = g
f.o = g
f.s = g
i.y = j
i.p = j
h.z = j
h.t = g
h.o = g
h.s = g
g.z = j
g.t = d
g.o = d
g.s = d
l.o = b
l.s = j
l.u = j
l.w = k
d.z = j
d.t = h
d.o = h
d.s = g
assert g.t.z.p.x.p.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: D = None
        self.o: D = None
        self.s: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: A = None
        self.txt = txt

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

j.p = k
b.o = l
b.s = j
b.u = j
b.w = k
k.x = i
k.v = i
f.z = j
f.t = g
f.o = g
f.s = g
i.y = j
i.p = j
h.z = j
h.t = g
h.o = g
h.s = g
g.z = j
g.t = d
g.o = d
g.s = d
l.o = b
l.s = j
l.u = j
l.w = k
d.z = j
d.t = h
d.o = h
d.s = g
assert g.t.z.p.x.p.p.txt == "k"