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

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

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

j = A("j")
g = B("g")
b = C("b")
l = A("l")
n = B("n")
h = C("h")
c = B("c")
d = B("d")
f = A("f")
k = B("k")

j.p = h
j.w = f
j.u = l
g.z = h
g.y = b
g.u = f
b.q = h
b.s = h
b.w = g
l.p = h
l.w = f
l.u = j
n.z = b
n.y = b
n.u = f
h.q = b
h.s = b
h.w = n
c.z = b
c.y = h
c.u = f
d.z = b
d.y = h
d.u = f
f.p = h
f.w = l
f.u = j
k.z = h
k.y = h
k.u = l
assert c.y.w.z.w.u.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: A = None
        self.u: A = None
        self.txt = txt

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

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

j = A("j")
g = B("g")
b = C("b")
l = A("l")
n = B("n")
h = C("h")
c = B("c")
d = B("d")
f = A("f")
k = B("k")

j.p = h
j.w = f
j.u = l
g.z = h
g.y = b
g.u = f
b.q = h
b.s = h
b.w = g
l.p = h
l.w = f
l.u = j
n.z = b
n.y = b
n.u = f
h.q = b
h.s = b
h.w = n
c.z = b
c.y = h
c.u = f
d.z = b
d.y = h
d.u = f
f.p = h
f.w = l
f.u = j
k.z = h
k.y = h
k.u = l
assert c.y.w.z.w.u.txt == "f"