class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.w: D = None
        self.x: C = None
        self.u: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: D = None
        self.y: A = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: D = None
        self.y: A = None
        self.txt = txt

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

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

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

k.p = e
k.w = f
k.x = h
k.u = j
c.u = e
c.s = f
c.y = k
h.t = c
l.p = h
b.p = c
b.w = f
b.x = h
b.u = j
e.u = c
e.s = f
e.y = k
f.p = h
i.u = c
i.s = f
i.y = j
g.u = e
g.s = l
g.y = j
j.p = g
j.w = f
j.x = h
j.u = k
assert e.y.w.p.t.u.s.p.t.s.txt == "f"