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

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

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

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

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

n.o = a
n.p = j
l.t = c
l.y = c
l.s = e
l.v = h
f.r = k
f.s = j
f.y = c
f.w = c
c.o = j
j.t = h
j.y = h
j.s = f
j.v = c
h.o = a
a.t = c
a.v = c
a.y = h
a.s = f
k.r = e
k.s = j
k.y = c
k.w = h
e.r = k
e.s = j
e.y = h
e.w = c
g.o = l
g.p = a
assert a.s.w.o.s.y.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: B = None
        self.txt = txt

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

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

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

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

n.o = a
n.p = j
l.t = c
l.y = c
l.s = e
l.v = h
f.r = k
f.s = j
f.y = c
f.w = c
c.o = j
j.t = h
j.y = h
j.s = f
j.v = c
h.o = a
a.t = c
a.v = c
a.y = h
a.s = f
k.r = e
k.s = j
k.y = c
k.w = h
e.r = k
e.s = j
e.y = h
e.w = c
g.o = l
g.p = a
assert a.s.w.o.s.y.txt == "c"