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

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

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

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

j = A("j")
e = B("e")
m = C("m")
h = D("h")
f = D("f")
c = A("c")
g = B("g")
a = C("a")

j.t = e
j.o = f
j.w = m
j.s = h
e.q = g
e.w = h
m.o = f
m.t = f
m.p = c
h.s = c
f.s = c
c.t = g
c.o = f
c.w = a
c.s = h
g.q = e
g.w = h
a.o = f
a.t = h
a.p = j
assert j.o.s.w.o.s.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: D = None
        self.w: C = None
        self.s: D = None
        self.txt = txt

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

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

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

j = A("j")
e = B("e")
m = C("m")
h = D("h")
f = D("f")
c = A("c")
g = B("g")
a = C("a")

j.t = e
j.o = f
j.w = m
j.s = h
e.q = g
e.w = h
m.o = f
m.t = f
m.p = c
h.s = c
f.s = c
c.t = g
c.o = f
c.w = a
c.s = h
g.q = e
g.w = h
a.o = f
a.t = h
a.p = j
assert j.o.s.w.o.s.txt == "c"