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

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: A = None
        self.u: D = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: A = None
        self.u: D = None
        self.txt = txt

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

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

j.y = g
j.v = f
g.x = k
g.w = j
g.t = f
g.o = l
b.r = j
b.q = j
b.u = f
l.s = f
l.z = f
l.o = k
k.x = g
k.w = j
k.t = l
k.o = l
h.y = g
h.v = f
f.s = l
f.z = l
f.o = k
assert g.o.z.o.txt == "k"