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

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

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

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

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

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

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

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

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

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

f.o = a
f.r = a
f.z = b
f.t = g
b.u = n
b.w = a
b.y = f
j.s = n
j.y = i
c.s = h
c.p = a
c.u = n
e.o = a
e.z = b
e.r = h
e.t = g
a.o = h
a.z = n
a.r = f
a.t = j
g.s = b
g.y = i
i.s = a
i.p = h
i.u = n
n.u = b
n.w = h
n.y = e
h.o = f
h.r = f
h.z = n
h.t = j
assert n.y.r.o.r.t.s.w.t.y.txt == "i"