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

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

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

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

f = A("f")
j = B("j")
h = C("h")
i = D("i")
m = B("m")
b = A("b")
d = C("d")
l = D("l")
k = D("k")

f.w = l
j.z = m
j.x = d
j.w = l
h.t = i
h.p = i
h.v = j
h.y = f
i.y = f
i.x = l
i.u = h
i.s = d
m.z = j
m.x = d
m.w = l
b.w = l
d.t = i
d.v = m
d.y = f
d.p = l
l.y = b
l.x = k
l.u = h
l.s = d
k.y = f
k.x = i
k.u = h
k.s = h
assert h.y.w.u.v.w.s.t.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

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

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

f = A("f")
j = B("j")
h = C("h")
i = D("i")
m = B("m")
b = A("b")
d = C("d")
l = D("l")
k = D("k")

f.w = l
j.z = m
j.x = d
j.w = l
h.t = i
h.p = i
h.v = j
h.y = f
i.y = f
i.x = l
i.u = h
i.s = d
m.z = j
m.x = d
m.w = l
b.w = l
d.t = i
d.v = m
d.y = f
d.p = l
l.y = b
l.x = k
l.u = h
l.s = d
k.y = f
k.x = i
k.u = h
k.s = h
assert h.y.w.u.v.w.s.t.txt == "i"