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

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

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

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

f = A("f")
i = B("i")
e = C("e")
n = D("n")
g = A("g")
m = A("m")
k = B("k")
a = B("a")
h = C("h")

f.o = a
f.v = k
f.s = k
f.r = h
i.q = h
i.o = a
e.p = n
n.y = k
n.p = h
g.o = k
g.v = k
g.s = k
g.r = e
m.o = a
m.v = i
m.s = k
m.r = e
k.q = e
k.o = i
a.q = e
a.o = k
h.p = n
assert i.q.p.y.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: B = None
        self.s: B = None
        self.r: C = None
        self.txt = txt

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

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

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

f = A("f")
i = B("i")
e = C("e")
n = D("n")
g = A("g")
m = A("m")
k = B("k")
a = B("a")
h = C("h")

f.o = a
f.v = k
f.s = k
f.r = h
i.q = h
i.o = a
e.p = n
n.y = k
n.p = h
g.o = k
g.v = k
g.s = k
g.r = e
m.o = a
m.v = i
m.s = k
m.r = e
k.q = e
k.o = i
a.q = e
a.o = k
h.p = n
assert i.q.p.y.txt == "k"