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

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

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

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

l = A("l")
c = B("c")
g = C("g")
f = D("f")
k = B("k")
h = B("h")
j = A("j")
i = B("i")

l.t = j
l.y = k
l.o = f
l.x = f
c.y = f
c.w = g
c.o = g
c.r = l
g.t = l
g.z = f
g.y = i
g.v = i
f.w = j
k.y = f
k.w = g
k.o = g
k.r = l
h.y = f
h.w = g
h.o = g
h.r = l
j.t = l
j.y = h
j.o = f
j.x = f
i.y = f
i.w = g
i.o = g
i.r = j
assert f.w.y.y.w.o.w.txt == "
class A:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: B = None
        self.o: D = None
        self.x: D = None
        self.txt = txt

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

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

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

l = A("l")
c = B("c")
g = C("g")
f = D("f")
k = B("k")
h = B("h")
j = A("j")
i = B("i")

l.t = j
l.y = k
l.o = f
l.x = f
c.y = f
c.w = g
c.o = g
c.r = l
g.t = l
g.z = f
g.y = i
g.v = i
f.w = j
k.y = f
k.w = g
k.o = g
k.r = l
h.y = f
h.w = g
h.o = g
h.r = l
j.t = l
j.y = h
j.o = f
j.x = f
i.y = f
i.w = g
i.o = g
i.r = j
assert f.w.y.y.w.o.w.txt == "j"